import request from '@/config/axios'

// 调拨出库主 VO
export interface Rdrecord07VO {
  id: number // id
  serialNumber: string // 流水号
  personId: number // 业务员id
  deptId: number // 部门id
  inWarehouseId: number // 调入仓库id
  outWarehouseId: number // 调出仓库id
  orderDate: Date // 订单日期
  remark: string // 备注
  auditor: string // 审核人
  auditTime: Date // 审核时间
}

// 调拨出库主 API
export const Rdrecord07Api = {
  // 查询调拨出库主分页
  getRdrecord07Page: async (params: any) => {
    return await request.get({ url: `/wms/rdrecord07/page`, params })
  },

  // 查询调拨出库主详情
  getRdrecord07: async (id: string) => {
    return await request.get({ url: `/wms/rdrecord07/get?id=` + id })
  },

  // 新增调拨出库主
  createRdrecord07: async (data: Rdrecord07VO) => {
    return await request.post({ url: `/wms/rdrecord07/create`, data })
  },

  //提交
  submit: async (id: number) => {
    return await request.get({ url: `/wms/rdrecord07/startProcess?id=` + id })
  },

  // 修改调拨出库主
  updateRdrecord07: async (data: Rdrecord07VO) => {
    return await request.put({ url: `/wms/rdrecord07/update`, data })
  },

  // 删除调拨出库主
  deleteRdrecord07: async (id: number) => {
    return await request.delete({ url: `/wms/rdrecord07/delete?id=` + id })
  },

  // 导出调拨出库主 Excel
  exportRdrecord07: async (params) => {
    return await request.download({ url: `/wms/rdrecord07/export-excel`, params })
  },

// ==================== 子表（调拨出库子） ====================

  // 获得调拨出库子列表
  getRdrecords07ListByOrderId: async (orderId) => {
    return await request.get({ url: `/wms/rdrecord07/rdrecords07/list-by-order-id?orderId=` + orderId })
  },
}
